package com.kaiwukj.android.ufamily.mvp.ui.page.service;

import com.kaiwukj.android.mcas.mvp.IModel;
import com.kaiwukj.android.mcas.mvp.IView;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.ListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.helper.ServiceHelperResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.params.PostComplainParams;
import com.kaiwukj.android.ufamily.mvp.http.entity.params.PostRepairParams;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.CommunityNewResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.CommunityNoticeResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.CommunityStatus;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.ComplainResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.GMAppointmentOrderResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.GMOrderDetailResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.GMOrderResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.PropertyFeeResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.RepairsResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.ServiceGroupResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.ServiceResult;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;

public interface ServiceContract {

    interface View extends IView {
        void onFetchServiceGroup(ServiceHelperResult result);
    }

    interface DetailView extends IView {
        void onFetchServiceParams(List<ServiceResult.ServiceInfo> result);

        void onGetService(ServiceResult result);
    }

    interface RepairsView extends IView {
        void onFetchRepairsList(List<RepairsResult> results);

        void onGetQiNiuToken(String token);
    }

    interface ComplainView extends IView {
        void onFetchComplainList(List<ComplainResult> results);

        void onGetQiNiuToken(String token);
    }

    interface PropertyView extends IView {
        void onPropertyResult(List<PropertyFeeResult> results);

        void onWXPayResult(Map<String, Object> payResult);

        void onAliPayResult(Map<String, Object> payResult);
    }

    interface CommunityNoticeView extends IView {
        void onFetchResult(List<CommunityNoticeResult> results);

        void onGetResult(CommunityNoticeResult result);
    }

    interface CommunityNewView extends IView {
        void onFetchResult(List<CommunityNewResult> results);
    }

    interface GMOrderView extends IView {
        void onFetchGMOrder(List<GMOrderResult> results);

        void onFetchGMAppointmentOrder(List<GMAppointmentOrderResult> results);

        void onGetOrderDetail(GMOrderDetailResult result);
    }

    interface Model extends IModel {

        Observable<CommunityStatus> whetherOwner();

        Observable<List<ServiceGroupResult>> fetchServiceGroup();

        Observable<ServiceResult> getServiceResult(int serviceId);

        Observable<List<ServiceResult.ServiceInfo>> fetchServiceParams(int serviceId);

        Observable<Integer> postComplain(PostComplainParams params);

        Observable<ListResp<ComplainResult>> fetchComplainList(int page, int pageSize);

        Observable<Integer> postRepair(PostRepairParams params);

        Observable<Integer> confirmRepairFinish(int repairId);

        Observable<ListResp<RepairsResult>> fetchRepairList(int page, int pageSize);

        /**
         * 保修评价
         *
         * @param id              保修记录ID
         * @param evaluateContent 评价内容
         * @param images          图片(多张用逗号分隔)
         * @return resultCode
         */
        Observable<Integer> postRepairEvaluate(int id, String evaluateContent, String images);

        Observable<String> getQiNiuToken();

        /**
         * 查询物业账单
         *
         * @param type 账单类型 1房屋 2车位 3车辆，4其他
         * @return PropertyFeeResult
         */
        Observable<List<PropertyFeeResult>> fetchPropertyFee(int type);

        /**
         * 支付物业账单
         *
         * @param payType (1支付宝 2微信）
         * @param refId   关联ID，type结合使用，1则关联房屋id，2则关联车位id'）
         * @param type    账单类型 1房屋 2车位 3车辆，4其他
         * @return 成功?
         */
        Observable<Map<String, Object>> payfeeProperty(int payType, int refId, int type);

        /**
         * 获取物业公告列表
         *
         * @param page     page
         * @param pageSize pageSize
         * @return CommunityNoticeResult ArrayList
         */
        Observable<ListResp<CommunityNoticeResult>> fetchCommunityNotice(int page, int pageSize);

        Observable<CommunityNoticeResult> getCommunityNotice(int id);

        //获取装修订单
        Observable<ListResp<GMOrderResult>> fetchGMOrder(int page, int pageSize);

        //获取装修预约订单
        Observable<ListResp<GMAppointmentOrderResult>> fetchGMAppointmentOrder(int page, int pageSize);

        Observable<GMOrderDetailResult> getGMOrderDetail(int orderId);

        Observable<ListResp<CommunityNewResult>> fetchCommunityNewData(int communityId);

    }
}
